from django.contrib.auth.mixins import LoginRequiredMixin
from django import http

class LoginRequiredJSONMixin(LoginRequiredMixin):

    # 重写 父类 的未登录的函数
    def handle_no_permission(self):
        return http.JsonResponse({'code':400,'errmsg':'未登录'})